<?php
declare (strict_types = 1);

namespace app;

use app\service\ConfigService;
use think\facade\Config;
use think\Service;

/**
 * 应用服务类
 */
class AppService extends Service
{
    public function register()
    {
        // 服务注册
    }

    public function boot()
    {
        defined('DS') || define('DS', '/');
        $config =   cache('DB_CONFIG_DATA');
        if(!$config){
            $service = app()->make(ConfigService::class);
            $config = $service->lists();
            cache('DB_CONFIG_DATA',$config);
        }
        Config::set($config,"global");
    }
}
